<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddAuthInfoToServerTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('server', function (Blueprint $table) {
            $table->bigInteger('user_id_cooperation')->nullable()->default(0)->comment('授权人id')->after('user_id');
            $table->smallInteger('cooperation_ratio')->nullable()->default(30)->comment('授权人分成')->after('user_id_cooperation');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('server', function (Blueprint $table) {
            $table->removeColumn('user_id_cooperation');
            $table->removeColumn('cooperation_ratio');

        });
    }
}
